ARM: vITS: handle MAPD command
authorAndre Przywara <andre.przywara@arm.com>
Wed, 7 Sep 2016 00:48:40 +0000 (01:48 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 14 Jun 2017 18:38:38 +0000 (11:38 -0700)
commit08055c8ea71b4959908caf3b511cddd648085768
tree30ec86f3740ada154e6f6a18a617b4287f3519ee
parent70a7fe3a55da5620cc53258b68e5aa3b651eb9f6
ARM: vITS: handle MAPD command

The MAPD command maps a device by associating a memory region for
storing ITEs with a certain device ID. Since it features a valid bit,
MAPD also covers the "unmap" functionality, which we also cover here.
We store the given guest physical address in the device table, and, if
this command comes from Dom0, tell the host ITS driver about this new
mapping, so it can issue the corresponding host MAPD command and create
the required tables. We take care of rolling back actions should one
step fail.
Upon unmapping a device we make sure we clean up all associated
resources and release the memory again.
We use our existing guest memory access function to find the right ITT
entry and store the mapping there (in guest memory).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/gic-v3-its.c
xen/arch/arm/gic-v3-lpi.c
xen/arch/arm/vgic-v3-its.c
xen/include/asm-arm/gic_v3_its.h